home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2342 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  871 b 

  1. Path: news.nstn.ca!news
  2. From: nstn181a@fox.nstn.ca (Pierre G. Boutquin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Q:order of evaluation
  5. Date: Tue, 16 Jan 96 23:36:06 -0400
  6. Organization: Nova Scotia Technology Network
  7. Message-ID: <4dhuip$1t0@news.nstn.ca>
  8. NNTP-Posting-Host: toronto-ts-01.nstn.ca
  9.  
  10. In <4dggjv$vs6@navet.enator.se>, Enator A/S writes:
  11. >The precedence dominates over the grouping, so the grouping is only used 
  12. >when the precedence of the operators are the same. () has the highest 
  13. >precedence, so (i+=1) is evaluated first.
  14. >
  15. >Hardy, ENATOR
  16. >
  17.  
  18. Nope.
  19.  
  20. I believe C++ is no different than ANSI C in this respect.  The order
  21. of evaluation is only guaranteed:
  22. 1. At the _end_ of a full expression;
  23. 2. After the first operand of &&, ||, ?: and the , operator;
  24. 3. After evaluation of all function arguments and function expression
  25. in a function call.
  26.  
  27. L8R!
  28.  
  29. Pierre.
  30.